package test5

object Pianhanshu {
  def main(args: Array[String]): Unit = {
    val pf:PartialFunction[Any,Int]={
      case x:Int=>x*10
      case x:String if x=="four"=>4
    }
    var l=List(1,2,3,4.6,"four","five")
    var l2=l.collect(pf)
    println(l2)
    //l.collect(x=>x*10)

  }
}
